package com.IRule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 张红娟
 * @Date: 2021/9/15 19:08
 * @Version: 1.0
 */
@Configuration
// 该类要放在启动类包外边，不然不会走自定义的负载均衡策略
public class MyIRule {
    @Bean
    public IRule myRule() {
        return new RandomRule();
    }
}
